package sb.simple.swagger;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("swaggerB")
@Api(value = "/swaggerB", tags = "分组B")
public class SwaggerBController {

    @GetMapping("hi")
    @ApiOperation(value = "打招呼", notes = "对传入的对象进行打印", httpMethod = "GET", code = 200)
    public String hi(Swagger swagger) {
        return "hello, id:" + swagger.getId() + ", name:" + swagger.getName() + ", age:" + swagger.getAge();
    }

    @PostMapping("hello")
    @ApiOperation(value = "打招呼", notes = "对传入的对象进行打印", httpMethod = "POST", code = 200)
    public String hello(Swagger swagger) {
        return "hello, id:" + swagger.getId() + ", name:" + swagger.getName() + ", age:" + swagger.getAge();
    }
}
